﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EzDesk.Utility.TimerService
{
    public class TimerTaskBase : ITimerTask
    {
        protected TimerTaskBase(string taskName = "TimerTask")
        {
            TaskName = taskName;
        }

        public string TaskName { get; set; }

        public virtual bool CanExecute()
        {
            return true;
        }

        public void Execute(object state)
        {
            try
            {
                doExecute();
            }
            catch (Exception ex)
            {
            }
        }

        public virtual DateTime ExecuteTime { get; protected set; }



        protected virtual void doExecute()
        {
            return;
        }
    }
}
